<template>
  <GlobalConfig />
  <router-view />
</template>
<script setup lang="ts">
import GlobalConfig from './components/GlobalConfig.vue'
import { useAppStore } from './stores/app'
const upStatus = computed(() => useAppStore().upgradeStatus)
onMounted(() => {
  if (upStatus.value === 0) return
  document.body.addEventListener('plugin_web_update_notice', () => {
    CloudModal.confirm({
      title: '版本升级',
      content: '程序版本更新，请刷新页面以获取最新的资源',
      closable: false,
      maskClosable: false,
      escToClose: false,
      hideCancel: true,
      width: 420,
      okText: '刷新',
      onOk: () => {
        window.location.reload()
      }
    })
  })
})
</script>
